package cn.hcbycloud.auth.service;


import cn.hcbycloud.auth.bo.TenantCustBO;
import cn.hcbycloud.auth.mapper.TenantCustMapper;
import cn.hcbycloud.auth.model.TenantCust;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 租户客户关系
 * @author gaoheng
 * @date 2022-01-21 12:20:31
 */
@Service
@AllArgsConstructor
public class TenantCustService extends ServiceImpl<TenantCustMapper, TenantCust> {
    private TenantCustMapper tenantCustMapper;

    /**
     * 建立租户客户关系
     * @param tenantCustBo
     * @return
     */
    public void addTenantCustInfo(TenantCustBO tenantCustBo) {
        TenantCust tenantCust = new TenantCust();
        tenantCust.setCustId(tenantCustBo.getCustId());
        tenantCust.setTenantId(tenantCustBo.getTenantId());
        tenantCust.preInsert();
        tenantCustMapper.insert(tenantCust);
    }
}
